import requests
import json


def main():
        
    url = "https://qianfan.baidubce.com/v2/app/conversation/runs"
    
    payload = json.dumps({
        "app_id": "25f02f42-c7e2-4076-bb46-8f67451937a9",
        "query": input('请输入问题:'),
        "stream": False,
        "conversation_id": "07c387d8-379d-4a56-8f08-82aa784b6e67"
        "file_ids":[
            "从文件上传接口取的id"
        ]
    })
    headers = {
        'Content-Type': 'application/json',
        'X-Appbuilder-Authorization': 'Bearer bce-v3/ALTAK-khq40RtWDkdbDHGMOWxHS/b0ed6d0b12013a597e4d1f86ffe134d35afd62f1'
    }
    
    response = requests.request("POST", url, headers=headers, data=payload)
    
    print(response.text)
    

if __name__ == '__main__':
    main()
